package com.cloudfun.campusshare.entity;

import com.cloudfun.campusshare.common.constant.ProductType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created by Huqin on 2020/5/11
 */
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "device_mode_set")
public class DeviceModeSetEntity extends CreatorPersistenceEntity {

    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @ManyToOne
    @JoinColumn(name = "brand_id", insertable = false, updatable = false)
    private DeviceBrandEntity brand;

    @Column(name = "brand_id", columnDefinition = ("varchar(40) not null comment '品牌'"))
    private String brandId;

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = ("varchar(40) not null comment '产品类型'"))
    private ProductType productType;

    @Column(columnDefinition = ("varchar(40) not null comment '设备型号/设备类型'"))
    private String deviceType;

    @Column(columnDefinition = ("varchar(40) not null comment '设备型号/设备类型'"))
    private String deviceTypeName;

//    @ManyToOne
//    @JoinColumn(name = "mode_id", insertable = false, updatable = false)
//    private DeviceModeEntity mode;
//
//    @Column(name = "mode_id", columnDefinition = ("varchar(40) not null comment '模式id'"))
//    private String modeId;

    @Column(columnDefinition = ("varchar(32) not null comment '模式集名称'"))
    private String name;

    @Column(columnDefinition = ("varchar(32) default null comment '描述'"))
    private String description;

    @Column(columnDefinition = ("varchar(40) not null comment '所属商户Id'"))
    private String merchantId;

}
